<template>
  <div class="login">
    <p>登录页面</p>
    <p>
      <button @click="login">登录</button>
    </p>
    <p></p>
  </div>
</template>
<script>
import Vue from "vue";
import { mapActions, mapState } from "vuex";
import { SET_STORE } from "@/store/info";
export default {
  data() {
    return {};
  },
  methods: {
    ...mapActions([SET_STORE]),
    login() {
      debugger;
      this.SET_STORE({ isLogin: true });
      this.$router.replace({ path: "/home" });
    }
  },
  computed: mapState({
    isLogin: state => state.info.isLogin
  })
};
</script>
<style>
</style>